﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace EvaluationSystem.ConfigurationPages
{
    public partial class ConfigurationPage : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Utility.IsLogin(this.Page))
            {
#if !DEBUG
                Response.Redirect("../Default.aspx");
#endif
            }
            Ext.Net.TreeNode root = new Ext.Net.TreeNode("管理", Ext.Net.Icon.ApplicationForm);
            root.Expanded = true;
            InitSettingsTree(root);
            tpSettings.Root.Add(root);
        }

        private void InitSettingsTree(Ext.Net.TreeNode root)
        {
            Ext.Net.TreeNode staffSettingsNode = new Ext.Net.TreeNode("人员管理", Ext.Net.Icon.ApplicationAdd);
            staffSettingsNode.Expanded = true;
            root.Nodes.Add(staffSettingsNode);
            Ext.Net.TreeNode staffAdding = new Ext.Net.TreeNode("增加员工", Ext.Net.Icon.ApplicationEdit);
            staffAdding.Href = "StaffAddingPage.aspx";
            staffSettingsNode.Nodes.Add(staffAdding);

            Ext.Net.TreeNode staffEdit = new Ext.Net.TreeNode("管理员工信息", Ext.Net.Icon.ApplicationEdit);
            staffEdit.Href = "StaffPage.aspx";
            staffSettingsNode.Nodes.Add(staffEdit);

            //Ext.Net.TreeNode staffPassword = new Ext.Net.TreeNode("密码修改", Ext.Net.Icon.ApplicationEdit);
            //staffPassword.Href = "#";
            //staffSettingsNode.Nodes.Add(staffPassword);

            Ext.Net.TreeNode pageSettingNode = new Ext.Net.TreeNode("配置表格", Ext.Net.Icon.ApplicationAdd);
            pageSettingNode.Expanded = true;
            root.Nodes.Add(pageSettingNode);

            Ext.Net.TreeNode pageTabs = new Ext.Net.TreeNode("增加页签", Ext.Net.Icon.ApplicationEdit);
            pageTabs.Href = "TabsPages/TabsAddingPage.aspx";
            pageSettingNode.Nodes.Add(pageTabs);

            Ext.Net.TreeNode pageManagerTabs = new Ext.Net.TreeNode("管理页签", Ext.Net.Icon.ApplicationEdit);
            pageManagerTabs.Href = "TabsPages/TabsPage.aspx";
            pageSettingNode.Nodes.Add(pageManagerTabs);

            Ext.Net.TreeNode pageSummary = new Ext.Net.TreeNode("增加平分指标项", Ext.Net.Icon.ApplicationEdit);
            pageSummary.Href = "SummaryPages/SummaryAddingPage.aspx";
            pageSettingNode.Nodes.Add(pageSummary);

            Ext.Net.TreeNode pageEditSummary = new Ext.Net.TreeNode("管理评分指标项", Ext.Net.Icon.ApplicationEdit);
            pageEditSummary.Href = "SummaryPages/SummaryPage.aspx";
            pageSettingNode.Nodes.Add(pageEditSummary);

            Ext.Net.TreeNode pageAddingEvaluation = new Ext.Net.TreeNode("增加评分内容", Ext.Net.Icon.ApplicationEdit);
            pageAddingEvaluation.Href = "EvaluationItemsPages/EvaluationItemsAddingPage.aspx";
            pageSettingNode.Nodes.Add(pageAddingEvaluation);

            Ext.Net.TreeNode pageEditEvaluation = new Ext.Net.TreeNode("管理评分内容", Ext.Net.Icon.ApplicationEdit);
            pageEditEvaluation.Href = "EvaluationItemsPages/EvaluationItemsPage.aspx";
            pageSettingNode.Nodes.Add(pageEditEvaluation);
        }


    }
}